[0.6.x] Backport PR #523 to cast data to iceberg table's pyarrow schema#559
Merged
HonahX merged 3 commits intoapache:pyiceberg-0.6.xfrom Mar 31, 2024
Conversation
HonahX
commented
Mar 29, 2024
| _check_schema_compatible(self.schema(), other_schema=df.schema) | ||
| # cast if the two schemas are compatible but not equal | ||
| if schema_to_pyarrow(self.schema()) != df.schema: | ||
| df = df.cast(schema_to_pyarrow(self.schema())) |
Contributor
Author
There was a problem hiding this comment.
Need to use schema_to_pyarrow directly here since schema.as_arrow() is not available in 0.6.x
kevinjqliu
reviewed
Mar 29, 2024
Contributor
kevinjqliu
left a comment
There was a problem hiding this comment.
LGTM! Would it be easier to pull #532 in instead of making a new commit?
Contributor
Author
|
@kevinjqliu I did not include that PR since that adds a new API and I think for a patch release we should not add any new functionality. I added that one to 0.7.0 milestone. WDYT? |
Contributor
|
that makes sense, thanks! |
93b61dd to
37d70c8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport #523
Depends on #560